<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>切换主题demo</title>
  <style>


    .container {
      display: flex;
      flex-direction: column;
      height: 100vh;
    }
    .container>.header ,.container>.main ,.container>.footer {
      background: #909399;
    }
    .container>.header {
      height: 120px;
    }

    .container>.main {
      flex: 1;
      opacity: .4;
    }

    .container>.footer {
      height: 120px;
      opacity: .8;
    }

    * {
      padding: 0;
      margin: 0;
    }
    .btn{
      display: inline-block;
      width: 100px;
      height: 100px;
      padding: 20px;
    }
  </style>
</head>

<body>
  <section class="container">
    <header class="header">
      <div class="btn" onclick="fn('#409EFF')">
        蓝
      </div>
      <div class="btn" onclick="fn('#E6A23C')">
        黄
      </div>
      <div class="btn" onclick="fn('#F56C6C')">
        红
      </div>
      <div class="btn" onclick="fn('#F56C6C')">
        绿
      </div>
    </header>
    <main class="main"></main>
    <footer class="footer"></footer>
  </section>
  <script>
    function fn(color){
      //
    }
    // getComputedStyle(document.documentElement).getPropertyPriority('--template-color')
  </script>
</body>

</html>